-- GENERATED SPELL FOR [Scarlet Magus] --


function spell0_1832(pUnit, Event) --@Blast Wave,Self--
pUnit:FullCastSpellOnTarget(15744,pUnit)
pUnit:RegisterEvent('Sorts_1832', 6318, 1)
end

function spell1_1832(pUnit, Event) --@Fire Ward,Self--
pUnit:FullCastSpellOnTarget(15041,pUnit)
pUnit:RegisterEvent('Sorts_1832', 0, 1)
end

function spell2_1832(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(9053,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_1832', 3000, 1)
end

function spell3_1832(pUnit, Event) --@Fireball Volley,n/a--
pUnit:FullCastSpellOnTarget(17203,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_1832', 3000, 1)
end

function Sorts_1832(pUnit, Event)
local choix_sorts_1832 = math.random(0, 3)
if choix_sorts_1832 == 0 then
pUnit:RegisterEvent('spell0_1832', 1, 1)
end
if choix_sorts_1832 == 1 then
pUnit:RegisterEvent('spell1_1832', 1, 1)
end
if choix_sorts_1832 == 2 then
pUnit:RegisterEvent('spell2_1832', 1, 1)
end
if choix_sorts_1832 == 3 then
pUnit:RegisterEvent('spell3_1832', 1, 1)
end
end

function mob1832_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_1832', math.random(1500, 3000), 1)
end

function mob1832_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob1832_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob1832_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(1832, 1, 'mob1832_Action')
RegisterUnitEvent(1832, 2, 'mob1832_Leave')
RegisterUnitEvent(1832, 3, 'mob1832_Kill')
RegisterUnitEvent(1832, 4, 'mob1832_Die')
